package com.data.structure.demo01;

import java.util.Stack;

public class ReadStackData {
    public static void main(String[] args) {
        Stack<String> stack = new Stack<>();
        stack.push("str1");
        stack.push("str2");
        stack.push("str3");
        stack.push("str4");
        stack.push("str5");
        stack.pop();
        for (String next : stack) {
            System.out.println(next);
        }
//        stack.iterator().forEachRemaining(System.out::println);
    }
}
